The present invention relates to encoding an image signal with highly efficient coding including orthogonal transformation and quantization; and in a particular application, the encoded image signal is recorded and reproduced by a digital VTR.
Digital VTRs digitize a video or image signal for recording on a magnetic tape. Since the bandwidth of a digital image signal is very wide, it is desirable to compress the digital image signal using highly efficient coding before recording it on the magnetic tape. Typically, a digital image signal is orthogonally transformed from its original time domain representation to a frequency domain representation. The transformed image data are compressed by quantizing, and then further compressed by variable length coding.
The amount of variable length encoded data varies from frame to frame, which makes it difficult to record such data in a fixed format on the magnetic tape. This problem is addressed by maintaining the amount of encoded data at an approximately constant amount per frame. More specifically, estimates of the amounts of encoded data which would result from using several different quantizing numbers are obtained. The optimal quantizing number is the one which results in the greatest amount of encoded data that is within a predetermined threshold. This optimal quantizing number is used by the quantizer to divide the transformed image data, thereby producing quantized data. Thus, the degree of compression provided by the quantizer is controlled through selection of an optimal quantizing number so that an approximately constant amount of data per frame is produced.
A conventional circuit for determining the optimum quantizing number is shown in FIG. 1. Frequency spectrum coefficient data representing the image signal, produced by an orthogonal transformation of the image signal, such as a discrete cosine transformation (DCT), are supplied to an input terminal 201. These coefficient data are arranged in blocks of 8 pixels.times.8 lines, as shown in FIG. 2, also referred to as orthogonally transformed image data blocks.
The blocks of transformed image data are supplied to a buffer memory 202, which has sufficient capacity to store, for example, 15 macro blocks. A macro block is comprised of six transformed image data blocks representing the same portion of the image signal. Four of these blocks have luminance information and two of these blocks have color difference information. A typical macro block is shown in FIG. 3.
The transformed image data are also supplied from the input terminal 201 to code amount estimating circuits 203-0 to 203-14, shown in FIG. 1, each of which includes a quantizer and estimates the amount of encoded data resulting from quantizing with one of a group of different quantizing numbers, also referred to as quantizing steps, #Q0, #Q1 . . . #Q14. The quantizing numbers progressively increase, with #Q0 having the smallest value and #Q14 having the largest value. In other words, the intensity or degree of estimated data compression progressively increases from estimating circuit 203-0 to estimating circuit 203-14.
The outputs of the code amount estimating circuits 203-0 to 203-14 are supplied to respective input terminals of comparison circuits 204-0 to 204-14. A target code amount is also supplied to the comparison circuits 204-0 to 204-14 from an input terminal 209. The target code amount is a target value for the amount of encoded data corresponding to an encoding set, also referred to as a buffering unit, having for example, 15 macro blocks. It is preferable that the amount of encoded data have the largest possible value which does not exceed the target code amount.
In the comparison circuits 204-0 to 204-14, the estimated amounts of quantized data corresponding to the respective quantizing numbers #Q0 to #Q14 are compared with the relevant target code amount. The outputs of the comparison circuits 204-0 to 204-14 are supplied to a quantizer determining circuit 205 which determines an optimum quantizing number.
For example, if each amount estimated by the code amount estimating circuits 203-0 to 203-5 is larger than the target code amount and each amount estimated by the code amount estimating circuits 203-6 to 203-14 is smaller than the target code amount, then the quantizing number #Q6 used in the code amount estimating circuit 203-6 is determined to be the optimum quantizing number, since it corresponds to an amount of encoded data which is the closest to and less than the target code amount.
The optimum quantizing number is supplied to a quantizer 206 to establish the quantizing level therefor, and then the data for an encoding set are read from the buffer memory 202 to the quantizer 206. The blocks of transformed image data in the encoding set are quantized by the quantizer 206 using the optimum quantizing number. The characteristic of the quantizer 206 is the same as that of each quantizer used in the code amount estimating circuits 203-0 to 203-14. The quantized data are supplied from the quantizer 206 to a variable length code encoding circuit 207, which encodes the quantized data using a variable length code such as a Huffman code. The variable length encoded data are output through an output terminal 208.
In the conventional VTR circuit for determining an optimum quantizing number, described above, one code amount estimating circuit is used for each of the quantizing numbers being evaluated. In such circuit construction, the number of code amount estimating circuits is large, which increases the circuit scale.